<template>
	<view style="width: 100vw;position: relative;">

		<!-- <status-bar></status-bar> -->
		<myLoading v-if="isLoading"></myLoading>
		<template v-else>

			<image  style="width: 100%;margin-top: -30rpx;" src="../../static/17.jpg" mode="widthFix"></image>

			


			<view @click="goBack" style="width: 200rpx;height: 155rpx;position: absolute;left: 0;top: 0;"></view>

		</template>
	</view>
</template>

<script>

import uniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
export default {
	components: {
		uniIcons
	},
	data() {
		return {
			isLoading: true,
			isone:true,
			formData: {
				name: '',
				phone: '',
				idCard: '',
				firstReceiveDate: '',
				avatar: ''
			},
		}
	},
	onLoad() {
		this.loadUserData();
		// 定义一个0.3-1的随机数
		let randomNum = Math.random() * 0.7 + 0.3;
		// 转换为毫秒
		let randomDelay = randomNum * 1000;
		// 延迟执行
		setTimeout(() => {
			setTimeout(() => {
				this.isLoading = false
			}, randomDelay)
		})
	},
	methods: {
		goMy() {
			uni.navigateTo({
				url: '/pages/my/my'
			})
		},
		
		loadUserData() {
				const userData = uni.getStorageSync('userInfo');
				console.log(':', userData);
				if (userData) {
					const parsedData = JSON.parse(userData);
					console.log('成功加载本地存储的数据:', parsedData);
					this.formData = parsedData;
					console.log('成功加载本地存储的数据:', this.formData);
				}
		},
		goBack() {
			uni.navigateBack();
		},
	}
}

</script>

<style lang="scss" scoped></style>
